<?php
/**
 * @author: zhouzhongyuan <435690026@qq.com>
 */


namespace webservice\helpers;


class LogDebug
{
    public static function log($info, $filename = '../logs/debug.txt')
    {
        ob_start();
        print_r($info);
        $content = ob_get_contents();
        ob_end_clean();
        file_put_contents($filename, $content, FILE_APPEND);
    }

    public static function error($content, $filename = '../logs/error.txt')
    {
        $content = "===================== HEADER ==========================\n" .
            $content .
            "===================== END ==========================\n";
        self::log($content, $filename);
    }

    public static function info($content, $filename = '../logs/info.txt')
    {
        $content = "===================== HEADER ==========================\n" .
            $content .
            "===================== END ==========================\n";
        self::log($content, $filename);
    }

}